From deb051deec5a5355e49f98a0427dac036c3c7471 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 13 Sep 2006 14:24:42 +0100 Subject: [PATCH] Better PIC code production: Using #pragma GCC visibility, *all* data references benefit, not just the ones to objects defined in the same translation unit. However, as this now is a header file change, detection logic cannot be used as nicely, so I guess we want to keep the previous change and add this one on top. Signed-off-by: Jan Beulich --- xen/include/xen/compiler.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h index 2cf74900dc..d70833efb5 100644 --- a/xen/include/xen/compiler.h +++ b/xen/include/xen/compiler.h @@ -35,6 +35,11 @@ #define offsetof(a,b) ((unsigned long)&(((a *)0)->b)) #endif +#if defined(__x86_64__) && (__GNUC__ > 3) +/* Results in more efficient PIC code (no indirections through GOT or PLT). */ +#pragma GCC visibility push(hidden) +#endif + /* This macro obfuscates arithmetic on a variable address so that gcc shouldn't recognize the original var, and make assumptions about it */ /* -- 2.30.2